﻿#pragma once
#include<typeinfo>
#include <iostream>
#include <time.h>
#include <cmath>
#include<vector>
namespace LK
{
	//基类
	struct Object;
	//引用计数类
	struct RefCount;
	//字符串
	struct String;
	//异常类型
	struct Exception;
	//类型信息类
	struct Type;
	//随机数生成器
	struct Random;
	//时间
	struct Time;
	//浅表复制接口
	struct ICloneables;

	//浅表复制接口代理
	struct PCloneables;
	//基类的代理
	struct PObject;
	//字符串的代理
	struct PString;
	//随机数生成器代理
	struct PRandom;
	//时间代理
	struct PTime;
	//类型信息类的代理
	struct PType;
	//异常类型代理
	struct PException;
	//空指针异常
	struct PPointerIsNullException;
	//未支持异常
	struct PNotSupportException;

	namespace Collection
	{
		//数组类型提前声明
		template<class T>struct PArray;
		//迭代器提前声明
		template<class T>struct ArrayIterator;
	}

#ifdef SUPPORT_VARIADIC_TEMPLATES
	//抛出异常的提前声明
	template<class T, class ...Args>inline void Throw(Args ...t);
#else
	//抛出异常的提前声明
#define TMPF(x) template<MF4_RepeatAsc_(class T,,0,x)>inline void Throw(MF4_RepeatAsc_(T, , 1, x));
	MF3_RepeatAsc(TMPF, 0, 16);
#undef TMPF
#endif
	//动态转换基类指针到派生类，不做检查
	template<class T, class BT>inline T* CastPointer(BT const* p);
	//静态转换派生类指针到基类，不做检查
	template<class T>inline Object* StaticCastPointer(T const* p);
	//检查指针，如果指针为NULL，则抛出异常
	template<class T, class BT>inline T* CheckPointer(BT const* p);
	//一个大小为size的结构体，size>0
	template<const int size>struct StructOfSize { unsigned char tmp[size]; };

	//类型重命名
	typedef unsigned long long u64;
	typedef unsigned long u32;
	typedef unsigned int ui32;
	typedef unsigned short u16;
	typedef unsigned char u8;
	typedef long long s64;
	typedef long s32;
	typedef int i32;
	typedef short s16;
	typedef signed char s8;

	typedef const unsigned long long cu64;
	typedef const unsigned long cu32;
	typedef const unsigned int cui32;
	typedef const unsigned short cu16;
	typedef const unsigned char  cu8;
	typedef const long long cs64;
	typedef const int ci32;
	typedef const long cs32;
	typedef const short cs16;
	typedef const signed char cs8;

#if _X64 == 1
	typedef long long index_t;
#else
	typedef int index_t;
#endif
#ifndef _WINDOWS
	typedef unsigned char BYTE;
	typedef unsigned short WORD;
	typedef unsigned long DWORD;
	typedef long HRESULT;
	typedef const wchar_t* LPCWSTR;
	typedef wchar_t* LPWSTR;
	typedef wchar_t WCHAR;
	typedef char CHAR;
	typedef const char* LPCSTR;
	typedef char* LPSTR;
	typedef void* PVOID;
#endif
	//右值引用符号
#ifdef SUPPORT_RIGHT_VALUE_REFERENCE
#define __RVR &&
#else
#define __RVR
#endif

}